#include "stdafx.h"
#include "TestDBManager.h"
#include "DBManager.h"

using namespace PDMS::PDMSFrame;

CPPUNIT_TEST_SUITE_REGISTRATION( TestDBManager );


TestDBManager::TestDBManager()
{
}


TestDBManager::~TestDBManager()
{
}

void TestDBManager::TestGetDatabase()
{
	DBManager manager;

	PDMSPerObjManager* pDb1 = NULL;
	PDMSPerObjManager* pDb2 = NULL;
	Configration config;

	pDb1 = manager.GetDatabase( &config );
	pDb2 = manager.GetDatabase( &config );

	CPPUNIT_ASSERT( pDb1 != NULL );
	CPPUNIT_ASSERT( pDb2 != NULL );
	CPPUNIT_ASSERT( pDb1 == pDb2 );
	CPPUNIT_ASSERT( manager.GetElementCount() == 1 );
}
